<template>
  <div class="about">
    <div v-html="detail.content"></div>
  </div>
</template>
<script>
import axios from 'axios'
import { reactive, toRefs } from 'vue'
import { useRoute } from 'vue-router'
export default {
  setup() {
    let route = useRoute()

    let state = reactive({
      detail: {}
    }) 
    // 请求详情数据
    axios.get('https://cnodejs.org/api/v1/topic/' + route.query.id).then(res => {
      // console.log(res);
      state.detail = res.data.data
    })

    return {
      ...toRefs(state)
    }
  }
}
</script>
<style lang="scss" scoped>
  .about {
    height: 100%;
    overflow: auto;
  }
</style>
